<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Untitled Page</title>
        <meta name="generator" content="WYSIWYG Web Builder 8 - http://www.wysiwygwebbuilder.com">
        <link rel="stylesheet" href="adminCss/WebBuilder.css" />
        <script type="text/javascript" src="adminScript/myAdminScript.js"></script>
    </head>
    <body>
        <form name="formAdmin">
            <input type="file" id="file" name="file" style="position:absolute;left:20px;top:80px;width:478px;height:25px;z-index:0;">
            <input type="submit" onclick="fnUpload()" id="btUpload" name="btUpload" value="Simpan" style="position:absolute;left:20px;top:110px;width:96px;height:25px;z-index:1;">
            <input type="reset" id="btReset" name="btReset" value="Batal" style="position:absolute;left:120px;top:110px;width:96px;height:25px;z-index:2;">
            <div id="wb_Text13" style="position:absolute;left:20px;top:10px;width:500px;height:51px;z-index:3;">
                <span style="color:#000000;font-family:Arial;font-size:43px;"><strong>Upload File</strong></span>
            </div>
            <div id="wb_Text14" style="position:absolute;left:20px;top:150px;width:500px;height:51px;z-index:4;">
                <?php
                @session_start();
                if (isset($_SESSION['file_ready'])) {
                    $sFileName = $_SESSION['file_name'];
                    $sFilePath = '../uploadedFile/';
                    
                    $filename = $sFilePath . $sFileName;
                    //echo 'File: ' . $filename;
                    
                    $fd = fopen($filename, "r");
                    $contents = fread($fd, filesize($filename));

                    fclose($fd);
                    $delimiter = ";";
                    $splitcontents = explode($delimiter, $contents);
                    $counter = "";
                ?>
                <font color="blue" face="arial" size="4">Complete File Contents</font>
                <hr>
                <?php 
                    echo $contents;
                ?>
                <br><br>
                <font color="blue" face="arial" size="4">Split File Contents</font>
                <hr>
                <?php 
                    foreach ( $splitcontents as $color ) {
                        $counter = $counter+1;
                        echo "<b>Split ".$counter.": </b>".$color."<br>";
                    }
                } else {
                    $sMessage = '';
                    if (isset($_SESSION['message'])) {
                        $sMessage = $_SESSION['message'];
                    }
                    echo $sMessage;
                }
                ?>
            </div>
        </form>
    </body>
</html>